using System;
using System.Data;
using System.Data.SqlClient;


/// <summary>
/// Summary description for SQLServer 
/// </summary>
public partial class SQLServer  
{
    private string connectionString = "";
    public string ConnectionString
    {
        set { connectionString = value; }
        get { return connectionString; }
    }
    private string errorMessage = "";
    public string ErrorMessage
    {
        set { errorMessage = value; }
        get { return errorMessage; }
    }
    private int errorCode = 0;
    public int ErrorCode
    {
        set { errorCode = value; }
        get { return errorCode; }
    }
    public SQLServer()
    {
        connectionString = "server=(local);" +
            "database=RecruitVietnamDb;" +
            "Integrated Security=SSPI;";
    }
    public SQLServer(string conString)
    {
        connectionString = conString;
    }
    void OpenConnection()
    {
        sqlConnection = new SqlConnection();
        sqlConnection.ConnectionString = connectionString;
        sqlConnection.Open();
    }
    void CloseConnection()
    {
        if (sqlConnection.State != ConnectionState.Open)
        {
            sqlConnection.Close();
        }
        sqlConnection.Dispose();
    }

    SqlConnection sqlConnection;
    SqlCommand sqlCommand;     
}
